Não sei se vai funcionar.
local tpId = 1387
local tps = {
["Orshabaal"] = {pos = {x=761, y=57, z=7}, toPos = {x=767, y=52, z=7}, time = 30},
}
function removeTp(tp)
local t = getTileItemById(tp.pos, tpId)
if t then
doRemoveItem(t.uid, 1)
doSendMagicEffect(tp.pos, CONST_ME_POFF)
end
end
function onDeath(cid)
local tp = tps[getCreatureName(cid)]
local x = 5 -- qtd de monstros que tem que matar.
if tp >= x then
doCreateTeleport(tpId, tp.toPos, tp.pos)
doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tp.time*1000, tp)
end
return TRUE
end








info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk
Bom gente, eu vi aqui na internet um script que, quando você matar X monster, abrirá um portal em certa posição, que levará a tal lugar, e o teleport durará X tempo.
Bom, eu gostaria de saber, se tem como adaptar o script, para precisar matar X quantidade de X monsters para abrir o portal entenderam?
Ai vai o script da quest:
tpmonster.lua
local tpId = 1387
local tps = {
["Orshabaal"] = {pos = {x=761, y=57, z=7}, toPos = {x=767, y=52, z=7}, time = 30},
}
function removeTp(tp)
local t = getTileItemById(tp.pos, tpId)
if t then
doRemoveItem(t.uid, 1)
doSendMagicEffect(tp.pos, CONST_ME_POFF)
end
end
function onDeath(cid)
local tp = tps[getCreatureName(cid)]
if tp then
doCreateTeleport(tpId, tp.toPos, tp.pos)
doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tp.time*1000, tp)
end
return TRUE
end
Vermelho - Monstro
Azul - Local em que o TP aparece na quest
Verde Escuro - Local onde o TP vai te teleportar
Roxo - Tempo em segundos que o TP fica aberto
Verde Claro - ID do TP no RME
Creaturescripts.xml
Tag do evento no monster:
Créditos pelo script:
TonyHalk